package cn.com.wangluotongxin.admin.model.constants;

public enum GoodsAuditStatus {

    AUDIT(1, "审核中"),
    PASS(2, "审核通过"),
    REJECT(3, "审核驳回"),
    RECALL(4, "审核撤回");

    private Integer code;
    public Integer getCode(){
        return this.code;
    }

    private String name;
    public String getName(){
        return this.name;
    }

    public static GoodsAuditStatus getByCode(Integer code){
        if(code == null){
            return null;
        }else {
            GoodsAuditStatus[] auditStatuses = values();
            for(GoodsAuditStatus auditStatus : auditStatuses){
                if(auditStatus.getCode().equals(code)){
                    return auditStatus;
                }
            }
        }
        return null;
    }

    GoodsAuditStatus(Integer code, String name){
        this.code = code;
        this.name = name;
    }
}
